corrected comments and cleaned up code in headers and src