Replace magic number.
Improve comments a bit.
Better documentation.