new validation method, refactored flag method