working tonegrid.java