Update and add test cases