Added documentation to the new methods, and a few changes to variable names for clarity.