small changes in logical2grid.