Honestly much of the code was a pure 'Copy-paste'! I am really _not_ a ruby programmer!! But I kinda got your point to some extent. Will try to clean this up.