updated the comments for the function