Updated header comments and dealts with all warnings.