Added some documentation, taken from the book with the original problem in it.