grid works, now we need to refactor and add tests