Added resetting globals to logout function, moved globals to globals section up top