more comments. Considering reducing some var declarations to reduce code. Less readable?