Adding 2D mode (see issue #21)