move input loop to main.rb