Added some comments and fixed password bug.