added more functions and tests