See the Animated Java Version Here.