Commit: added comment, refactored some codes
added comments