Updated print2D function