More function flow and benchmarking code