Add a parameter for whether loop should be zero based or not.