Very elegant solution, have a counter adding up within the loop