Add a smart comment function