Added a Lattice2D model. It should be a lot more efficient than the original in terms of garbage collection and the stack.