Thanks for your advice! I solved the issue and pretty much gutted the 
logic.

this thread can be closed if someone can do so

-- 
Posted via http://www.ruby-forum.com/.