working 2D and 1D codes