added timing diagram