added comments and changed variable names to camelCasing