added comments and cleaned shit up