Cleaned up var names and added comments.