Added timers
various optimizations