Check if sorted, tail recursive, with test. Exercise 2.2