adding timing code