more debugging of user function. offsets now stored in index, but still buggy..wtf..grrr...