Added benchmarks, drastically improved performance by rewriting helpter functions