This is the last of many failed attempts to fix the timing problem. Added some time benchmarks code.