Rem's solution to the exercises in programming pearls