had forgotten to add dimensions for right and bottom bounds check
improve new grid loc logic