Added method to handle new lines between numbers

Added method that deals with new lines, and a tester function which
tests it.