Added test cases for prev, next