         if (floor == 0) {
             return
         }
-        for request in requests {
-            if (request.floor == floor && request.direction == direction) {
-                _internalRemoveRequestByID(id: request.id)
-            }
-        }
+        debug(message: "clearing requests for floor: \(floor), direction: \(direction)")
+        _internalRemoveGoToRequests(floor: floor)
+        _internalRemoveDirectionRequests(floor: floor, direction: direction)
+    }
+    
+    private func _internalRemoveGoToRequests(floor: Int) {
+        self.requests = self.requests.filter() { $0.floor != floor && $0.direction == Direction.GoTo}
+    }
+    
+    private func _internalRemoveDirectionRequests(floor: Int, direction: Direction) {
+        self.requests = self.requests.filter() { $0.floor != floor && $0.direction != direction}
     }
     
     private func _internalCallBestElevator(direction: Direction, floor: Int) -> Elevator? {

                }
                
                if (open) {
                    elevator.arriveAtFloor(control: self)
                    if (elevator.floor == next.floor) {
                        _internalRemoveRequestByID(id: next.id)
                    }
                    _internalRemoveRequestsByFloor(floor: elevator.floor, direction: direction)
                    open = false
                }
            }

    }
    
    private func _internalRemoveRequestByID(id: String) {
        if let i = self.requests.index(where: { ($0.id == id)}) {
            let value = self.requests.remove(at: i)
            debug(message: "clearing request \(id): [\(i)] request: \(value.description())")
        }
    }
    
