Segregated the code, added comments, and added a function to grab the password from a separate file.