Add lookup performance, fix average calc to be only one place at a tme, add back -O3