Isnt that option just shifting of the array elements depending on MAX value.