implemented Ordering parameter (Lecture 5.3)