added some functions to Grid