Tried to add a base case when the array described contains only two elements.