Added middle index problem.