removed the unnecessary final index