Updated comments.
Improved sample algorithm.