code changes for 2D