merged Functions into Algorithms
store functions as variables