Puzzle Node problems in Ruby