attempted refactor of grid