finished shifting to relative indices, everything seems to work