Add benchmarking and bugfixing