Understanding preferred leg stiffness and layered control strategies for locomotion