added comments and fixed some header stuff