fix variable names and comments