some code for learning functional programming