Added some documentation from the code.