Learning to do somersaults