added functional programming practice