tests and benchmarks for O(n)