fixed commets and cleaned up code