Added checks to only run on 3d datasets