Updated get_val_cmt() function that takes \n char for comment.