More code reformatting and additions of documentation.