Fixed logic errors and slightly simplified user input