prototypes for sorting func