Added tests. Renamed functions and tests.