KWell's code is how I would do it too.