Updated javadoc and cleaned up code for MemoryGrid.java