What is `maxi` supposed to contain? The index to the maximum element value in the array? Then, I am not sure I get the logic here.