added timing functionality