Add comments for code
Refactoring and add more comments for code