added comments / cleaned code