code cleanup: added comments