move var declarations closer to their first uses

* Eliminated 1-char var names, except for `i`
* Removed the unused `resCombos` variable