code: public static int minusPOffset(int index, int offset, int size) {
  		index -= offset;
  		if( index < 0 ) {
  			return size + index;
  		} else {
  			return index;
  		}
  	}
docs: Subtracts a positive offset to index in a circular buffer.
  @param index element in circular buffer
  @param offset integer which is positive and less than size
  @param size size of the circular buffer
  @return new index