Finished writing basic functionality of Lattice.