added comments / cleaned up