the last element has to be the previous index (with -1 being the  previous of the first index)