fixed comments & added grid functions