changed file io to fit assignment better, need to clean up comments