better grid handling