added legal checker for legal subgrid