Improve variable naming, and comments