     sand.physicsBody = SKPhysicsBody(circleOfRadius: sand.size.width/2)
     sand.name = "sand"
     scene.addChild(sand)
+    sand.physicsBody!.restitution = 1.0
+    sand.physicsBody!.density = 20.0
+}
+
+func shake() {
+    scene.enumerateChildNodesWithName("sand") { node, _ in
+        node.physicsBody!.applyImpulse(CGVector(dx: 0, dy: random(min: 20, max: 40)))
+    }
 }
 
 delay(seconds: 2.0) {

scene.physicsWorld.gravity = CGVector(dx: 0, dy: 0)
scene.physicsBody = SKPhysicsBody(edgeLoopFromRect: scene.frame)
sceneView.showsFPS = true
sceneView.presentScene(scene)

XCPlaygroundPage.currentPage.liveView = sceneView

            SKAction.waitForDuration(0.1)
            ]),
        count: 100))
    delay(seconds: 12, completion: shake)
}
