lol, pretty neat.
If I would have written it, it would have been at least 3 times more lines of code.
But yeah, looks like this should do what he wanted. Nice one.