Timing function added to routines.c
Improvements