update UI and function and test cases