More functions, tests.