Quote Originally Posted by macropod View Post
Try:

Note that I've revised some of the earlier code to make it easier for people to understand and, hence, maintain.
Yes that is a lot more better. Great Job!!!!