clearComments function