Removed the unnecessary variable indexOfMovedShape.