added a bunch of comments

move this to above the function declaration