Add some more functions and tests