added comments and flag-text fn