Make sure works for 3d case