Can you share the function declaration and function definition of translateIndexToZeroBased