Added comments and small name changes

Made a small change in a variable name
Added comments