Updated some input line handling to make code simpler and more readable.