helper function + position checking within grid.
fasdf