Code cleanup

Better variable names and comments