Fixed desync between multiple beat alignments and abstracted some code