Updated code and comments to conform to the style of the rest of the file.