Benchmark - warning: this code has some duplication