Corey slid into second base when playing baseball. He complains of pain in his left ankle. The team doctor says Corey has probably sprained the ligaments in his ankle. What is the function of the ligaments?