add functional programming techniques