add working metronome logic