added grid functionality