Continued the docblock commenting, and cleaning up the code so that it's more legible and logical.