fixed grid.equals and messed in solver