added 3d interpolation correctly