fixed newline bug in reading from cin.