added some java code that turns the lattice into an image file