Fixed the error checking for user input and added reading and writing from files.