Can you check the code I posted. Like I said, it is rudimentary, but seems to be working.