timing code added