the 2d case
the 1d case
misc