Thank you @sparkmaddy, that actually helps a lot. I will post the code with the solution based on that.