refactored added comments