main program now reads lines from cin