diff --git a/secrules/__main__.py b/secrules/__main__.py
index 9eace7214a4cb5e74113ecb7be7d1f1e1bba0169_c2VjcnVsZXMvX19tYWluX18ucHk=..f189a61c23d238d92745463c26a274bf9553d44d_c2VjcnVsZXMvX19tYWluX18ucHk= 100644
--- a/secrules/__main__.py
+++ b/secrules/__main__.py
@@ -1,5 +1,6 @@
 # -*- coding: iso-8859-1 -*-
 
-import sys
+import argparse
+import importlib
 import os
 import re
@@ -4,7 +5,7 @@
 import os
 import re
-import argparse
-import importlib
+import sys
+from pathlib import Path
 
 DEBUG = False
 if DEBUG:
@@ -14,7 +15,7 @@
     # Unless a host and port are specified, host defaults to 127.0.0.1
     debugpy.configure(subProcess=False)
 
-    debugpy.listen(('0.0.0.0', 5678), in_process_debug_adapter=True)
-    print('Waiting for debugger attach')
+    debugpy.listen(("0.0.0.0", 5678), in_process_debug_adapter=True)
+    print("Waiting for debugger attach")
     debugpy.wait_for_client()
     debugpy.breakpoint()
@@ -19,6 +20,6 @@
     debugpy.wait_for_client()
     debugpy.breakpoint()
-    print('break on this line')
+    print("break on this line")
 
 
 all_rules = {}
@@ -39,7 +40,7 @@
                 getattr(m, r)(fo, export)
     else:
         for n in numrule:
-            rname = 'rule%s%02d' % (seclass[-2:], n)
+            rname = "rule%s%02d" % (seclass[-2:], n)
             if rname in rules:
                 if info:
                     print(getattr(m, rname).__name__)
@@ -52,12 +53,12 @@
 class InflateRange(argparse.Action):
     def __call__(self, parser, namespace, values, option_string=None):
         lst = []
-        for string in values:   # type: ignore
-            string = string.replace('(', '')
-            string = string.replace(')', '')
-            if '-' in string or ':' in string:
-                string = string.replace(':', '-')
-                m = re.match(r'(\d+)(?:-(\d+))?$', string)
+        for string in values:  # type: ignore
+            string = string.replace("(", "")
+            string = string.replace(")", "")
+            if "-" in string or ":" in string:
+                string = string.replace(":", "-")
+                m = re.match(r"(\d+)(?:-(\d+))?$", string)
                 # ^ (or use .split('-'). anyway you like.)
                 if not m:
                     raise argparse.ArgumentTypeError(
@@ -69,8 +70,8 @@
                 end = m.group(2) or start
                 lst.extend(list(range(int(start, 10), int(end, 10) + 1)))
             else:
-                string = string.replace(',', ' ')
-                for string in string.split(' '):
+                string = string.replace(",", " ")
+                for string in string.split(" "):
                     if string:
                         lst.append(int(string))
             setattr(namespace, self.dest, lst)
@@ -78,5 +79,7 @@
 
 def load_rules(levels):
     global all_rules
+
+
     mods = [
         fn[:-3]
@@ -81,7 +84,7 @@
     mods = [
         fn[:-3]
-        for fn in os.listdir('./secrules')
-        if fn.startswith('rule') and fn[-1:].lower() == 'y'
+        for fn in os.listdir(Path(__file__).parent)
+        if fn.startswith("rule") and fn[-1:].lower() == "y"
     ]
     all_rules = {}
     for modn in mods:
@@ -85,7 +88,7 @@
     ]
     all_rules = {}
     for modn in mods:
-        m = importlib.import_module('.' + modn, 'secrules')
+        m = importlib.import_module("." + modn, "secrules")
         # m = __import__('secrules.' + modn, globals(), locals(), ['*'], -1)
         lst = [m, []]
         for r in dir(m):
@@ -89,6 +92,6 @@
         # m = __import__('secrules.' + modn, globals(), locals(), ['*'], -1)
         lst = [m, []]
         for r in dir(m):
-            if r.startswith('rule'):
+            if r.startswith("rule"):
                 if (
                     levels is None
@@ -93,6 +96,6 @@
                 if (
                     levels is None
-                    or not hasattr(getattr(m, r), 'rule_level')
+                    or not hasattr(getattr(m, r), "rule_level")
                     or getattr(m, r).rule_level in levels
                 ):
                     lst[1].append(r)
@@ -102,5 +105,5 @@
 
 def main():
     global args
-    parser = argparse.ArgumentParser(description='security checker')
+    parser = argparse.ArgumentParser(description="security checker")
     parser.add_argument(
@@ -106,8 +109,8 @@
     parser.add_argument(
-        '--output',
-        type=argparse.FileType('w'),
-        dest='fo',
-        metavar='out-file',
-        help='output file',
+        "--output",
+        type=argparse.FileType("w"),
+        dest="fo",
+        metavar="out-file",
+        help="output file",
         default=sys.stdout,
     )
@@ -112,6 +115,4 @@
         default=sys.stdout,
     )
-    parser.add_argument(
-        '--class', type=int, dest='seclass', help='security class'
-    )
+    parser.add_argument("--class", type=int, dest="seclass", help="security class")
     parser.add_argument(
@@ -117,3 +118,3 @@
     parser.add_argument(
-        '--rule',
+        "--rule",
         action=InflateRange,
@@ -119,6 +120,6 @@
         action=InflateRange,
-        nargs='*',
-        dest='numrule',
-        help='rule number',
+        nargs="*",
+        dest="numrule",
+        help="rule number",
     )
     parser.add_argument(
@@ -123,6 +124,6 @@
     )
     parser.add_argument(
-        '--export',
-        action='store_true',
-        dest='export',
+        "--export",
+        action="store_true",
+        dest="export",
         default=False,
@@ -128,4 +129,4 @@
         default=False,
-        help='export format',
+        help="export format",
     )
     parser.add_argument(
@@ -130,6 +131,6 @@
     )
     parser.add_argument(
-        '--info',
-        action='store_true',
-        dest='info',
+        "--info",
+        action="store_true",
+        dest="info",
         default=False,
@@ -135,4 +136,4 @@
         default=False,
-        help='Rules info',
+        help="Rules info",
     )
     parser.add_argument(
@@ -137,4 +138,4 @@
     )
     parser.add_argument(
-        '--level',
+        "--level",
         action=InflateRange,
@@ -140,7 +141,7 @@
         action=InflateRange,
-        nargs='*',
-        dest='levels',
-        help='rule levels',
+        nargs="*",
+        dest="levels",
+        help="rule levels",
     )
 
     args = parser.parse_args()
@@ -149,10 +150,10 @@
 
     if args.seclass is None:
         if args.numrule is not None:
-            raise argparse.ArgumentTypeError('missing seclass argument')
+            raise argparse.ArgumentTypeError("missing seclass argument")
         lst = list(all_rules.keys())
         lst.sort()
         for seclass in lst:
             #            seclass = 'rules%02d' % args.seclass
             rules_exec(seclass, args.numrule, args.info, args.fo, args.export)
     else:
@@ -153,10 +154,10 @@
         lst = list(all_rules.keys())
         lst.sort()
         for seclass in lst:
             #            seclass = 'rules%02d' % args.seclass
             rules_exec(seclass, args.numrule, args.info, args.fo, args.export)
     else:
-        seclass = 'rules%02d' % args.seclass
+        seclass = "rules%02d" % args.seclass
         rules_exec(seclass, args.numrule, args.info, args.fo, args.export)
 
 
@@ -160,5 +161,5 @@
         rules_exec(seclass, args.numrule, args.info, args.fo, args.export)
 
 
-if __name__ == '__main__':
+if __name__ == "__main__":
     main()