Added interpolate_3d function