Add more comments, clarify var names