added comments + removed old code