xy2ijk returns the correct ijk coordinates