diff --git a/Main.c b/Main.c
index e2127c7ffdbb4107423cba722f7a249944694ac2..0b4b0df4ca5fccbe37d0aa9dcb534512b75db509 100644
--- a/Main.c
+++ b/Main.c
@@ -81,8 +81,8 @@ int main(int argc, char* argv[]) {
     int index;
     int return_int;
     int struct_number;
-    data_struct* data_array;
     thread_return_struct* return_struct;
+    thread_return_struct** thread_arrays;
 
     // Check for valid args.
     if (argc < 2) {
@@ -104,26 +104,30 @@ int main(int argc, char* argv[]) {
             // Open folder and create appropriate number of threads.
             open_folder();
 
+            thread_arrays = calloc(dir_file_counter, sizeof(*return_struct));
+
             // Iterate through all threads and grab returned value.
             for (index = 0; index < dir_file_counter; index++) {
                 pthread_join(thread_array[index], (void**) &return_struct);
-                data_array = return_struct->data_array;
-                for (struct_number = 0; struct_number <= return_struct->array_count; struct_number++) {
-                    printf("User: %-16s   ", data_array[struct_number].user_name);
-                    printf("Password: %-17s   ", data_array[struct_number].password);
-                    printf("Blood Type: %-7s   ", data_array[struct_number].blood_type);
-                    printf("Domain: %-28s   ", data_array[struct_number].domain_name);
-                    printf("DB Index: %-15d  \n", data_array[struct_number].db_index);
-                    free(data_array[struct_number].user_name);
-                    free(data_array[struct_number].password);
-                    free(data_array[struct_number].blood_type);
-                    free(data_array[struct_number].domain_name);
+
+                thread_arrays[index] = return_struct;
+
+                for (struct_number = 0; struct_number <= thread_arrays[index]->array_count; struct_number++) {
+                    printf("User: %-16s   ", thread_arrays[index]->data_array[struct_number].user_name);
+                    printf("Password: %-17s   ", thread_arrays[index]->data_array[struct_number].password);
+                    printf("Blood Type: %-7s   ", thread_arrays[index]->data_array[struct_number].blood_type);
+                    printf("Domain: %-28s   ", thread_arrays[index]->data_array[struct_number].domain_name);
+                    printf("DB Index: %-14d   \n", thread_arrays[index]->data_array[struct_number].db_index);
+                    free(thread_arrays[index]->data_array[struct_number].user_name);
+                    free(thread_arrays[index]->data_array[struct_number].password);
+                    free(thread_arrays[index]->data_array[struct_number].blood_type);
+                    free(thread_arrays[index]->data_array[struct_number].domain_name);
                 }
-                free(data_array);
+                free(thread_arrays[index]->data_array);
                 free(return_struct);
                 printf("\n\n");
             }
-
+            free(thread_arrays);
             free(absolute_path);
             free(thread_array);
         }