Create some counter integers to make life easier
Close properly
Rename ambiguous variable