fairly rudimentary grid-drawing logic.