Edited the comments and minor code clean-up.