added code example of functional-style oop