         pipeTextureDown.filteringMode = SKTextureFilteringMode.Nearest
         
         // create the pipes movement actions
-        var distanceToMove = CGFloat(self.frame.size.width + 2.0 * pipeTextureUp.size().width);
-        var movePipes = SKAction.moveByX(-distanceToMove, y:0.0, duration:NSTimeInterval(0.01 * distanceToMove));
-        var removePipes = SKAction.removeFromParent();
-        movePipesAndRemove = SKAction.sequence([movePipes, removePipes]);
+        var distanceToMove = CGFloat(self.frame.size.width + 2.0 * pipeTextureUp.size().width)
+        var movePipes = SKAction.moveByX(-distanceToMove, y:0.0, duration:NSTimeInterval(0.01 * distanceToMove))
+        var removePipes = SKAction.removeFromParent()
+        movePipesAndRemove = SKAction.sequence([movePipes, removePipes])
         
         // spawn the pipes
         var spawn = SKAction.runBlock({() in self.spawnPipes()})

    
    func spawnPipes() {
        var pipePair = SKNode()
        pipePair.position = CGPointMake( self.frame.size.width + pipeTextureUp.size().width * 2, 0 );
        pipePair.zPosition = -10;
        
        var height = UInt32( self.frame.size.height / 4 )
        var y = arc4random() % height + height;
        
        var pipeDown = SKSpriteNode(texture: pipeTextureDown)
        pipeDown.setScale(2.0)

        }
    }
    
    // TODO: Move to utilities somewhere. There's no reason this should be a member function
    func clamp(min: CGFloat, max: CGFloat, value: CGFloat) -> CGFloat {
        if( value > max ) {
            return max
        } else if( value < min ) {
            return min
        } else {
            return value
        }
    }
    
    
    override func update(currentTime: CFTimeInterval) {
        /* Called before each frame is rendered */
        bird.zRotation = self.clamp( -1, max: 0.5, value: bird.physicsBody.velocity.dy * ( bird.physicsBody.velocity.dy < 0 ? 0.003 : 0.001 ) )
    }
}
