# from http://stackoverflow.com/questions/18345202/functional-vs-imperative-style-in-python