master: refactoring code. getting bug with its comments