working on 2D code