Add tests for all functions