turned i into a benchmark function