add special casing for 1D; start working on 2D