implemented build_comment function