Simplified code, fixed parsing in loggedIn.csv, and added comments