Functional programming exercises