added timing, got rid of delay()