add function to benchmark
clean up code
remove unnecessary code