The skeletons of all mammals are based on a common pentadactyl ("five-fingered") template but optimised for different functions. While many mammals can perform other tasks using their forelimbs, their primary use in most terrestrial mammals is one of three main modes of locomotion: unguligrade (hoof walkers), digitigrade (toe walkers), and plantigrade (sole walkers). Generally, the forelimbs are optimised for speed and stamina, but in some mammals some of the locomotion optimisation have been sacrificed for other functions, such as digging and grasping.