The first hair drawn is the leader and his coordinates are recorded. The preceding hairs that are drawn have the opportunity to take control and be a new leader, at which point they choose new coordinates that are recorded.
The anti-aliasing looks better when drawn in Processing directly.
<A href="http://idblab.blogspot.com">Check out my blog</A>
To tweak this sketch, first download it.
Make your updates, then upload your tweak!