added benchmarking (time elapsed and memory usage)