Add code to make functions work.
Add tests from functions.