removed debugging puts
first try
update to new input file
Working version
Refactored
replaced "until" with each & break