some grid functions