added comments and comment headers, fixed 'unused' warnings