Improved Error Checking and added storage for user data