how does a coordinate grid work