final refactor try3.rb for day, not really satisfied how control flow in next is shown