Added comments and clarified some variable names