changed variable names and cleaned up comments