add test cases for optimization