PE1, with tail recursion(?)