refactored, rule corrected