         }
         
         let obstaclesInNextFrame = state.obstacles.filter {
-            $0.xCoordinate < state.myPlayer.xCoordinate + state.myPlayer.xWidth + state.currentSpeed &&
+            $0.xCoordinate < state.myPlayer.xCoordinate + state.myPlayer.xWidth + speed &&
             $0.xCoordinate + $0.xWidth >= state.myPlayer.xCoordinate
         }
         

        }
        
        for obstacle in state.obstacles {
            obstacle.xCoordinate -= state.currentSpeed
            if shouldRemoveObstacle(obstacle) {
                delegate.didRemoveObstacle(obstacle)
            } else {

    }
    
    private func updateDistance() {
        state.distance += speed
    }
    
    private func updatePlayerStates() {
