functions and Armindo's sort examples