for functional programming exercises