add timing.
simplify code.