Cleaned up the style and comments and unchecked assignment warnings.