Refactored some names. Added comments.