adding grid functions