Fixing code so 2d runs