Add function_builder function.

Using lambda and a for loop, wrote a function that rights functions.