Timing code impreovememnts