fixed typo that caused error with inputs larger than one line length