code cleanup.
separated RangeMap and hasTile() functions.