pattern generation mechanism for gait