added check for starting on 0 as it will cause a divide by zero error if using default subs