You do not need chomp on line 10 as to.i removes the new line character;