added timing mechanism