fixed variables, and cleaned up comments