maths ascending and descending order - Search