fixed more bugs only need to test applied rules and need to fix regex