more functions and test cases for user