added timming routines to keep main clean
start moving function declarations here
use the new timming functions