handle the age and sorting requirements