added grid.java and updates to other files