Geofence Detection Code