fixing bug for newline inputs and not reading in inputs correctly