added timing functionality to algorithms