sort all the functions