Fixed table capitalization, add comments
Implemented the loop, still a bug though on test data 1,2,4,5