Final submission

Changed a variable name for clarity and added some additional comments.