export functions and test