Added new functions and tests.