fixed functions and added benchmarks in go