Some style changes and added some documentation.