Corrected variable names and comments