Add getMonthsInRange function, minor style cleanup