add unit test for the code
modify index