Added more functions and propper tests.