Added some documentation and formating.