Thanks guys. I've been away for far too long.

Tumbleweed's code worked on the first try.