More documentation from original source. Renamed a few types.