added functions and test client