Added comments to functions. Removed unwanted code/comments. Cleaned up parsing of the xml result records.