Optimization everywhere!

Also added forgotten timing for an event.