refactored geofence to use timing logic.