Modules g02/g03: writed a sorting function for the two options