fleshed out timing code. correctness breaks