diff --git a/code/test.py b/code/test.py
index b407995..fe621f7 100644
--- a/code/test.py
+++ b/code/test.py
@@ -100,14 +100,41 @@ def AM(EODf, stimulus):
     return AM, nyquist
 
 def remove_poor(files):
-    good_files =files
-    print('x')
+    """
+    Removes poor datasets from the set of files for analysis
+
+    Parameters
+    ----------
+    files : list 
+        list of files.
+
+    Returns
+    -------
+    good_files : list
+        list of files without the ones with the label poor.
+
+    """
+    # create list for good files
+    good_files = []
+    # loop over files
+    for i in range(len(files)):
+        # print(files[i])
+        # load the file (takes some time)
+        data = rlx.Dataset(files[i])
+        # get the quality
+        quality = str.lower(data.metadata["Recording"]["Recording quality"][0][0])
+        # check the quality
+        if quality != "poor":
+            # if its good or fair add it to the good files
+            good_files.append(files[i])
     return good_files
 
 #find example data
 datafolder = "../../data"
 
-example_file = datafolder + "/" + "2024-10-16-ad-invivo-1.nix"
+example_file = datafolder + "/" + "2024-10-16-ah-invivo-1.nix"
+
+data_files = glob.glob("../../data/*.nix")
 
 #load dataset
 dataset = rlx.Dataset(example_file)