Add more functions and tests