thanks alot for your help, I really appreciate it.

I modified it sligthly to fit my needs, works nicely