Updated grid drawing logic.