added the code that works. It is tested outside of StepMania