code for benchmarking