method works, but unsure if the quasi 2D implementation is legal.