Thank you ChrisW67 for taking time to help, i tried recursive approach before but i didnt do it right so i switched to this. I will try what you suggested now and see how it goes...