Originally Posted by kingyman
edited as i found my own answer
And that was? You have been given help - so share your solution with others.
All the code given in this post has been tested and is intended to address the question asked.
Unless stated otherwise it is not just a demonstration.