clean up, added comments