3 gaits, 1 function to rule them all