[INTERNAL] refactored code: created subfunction to have smaller mainfunction 2
[INTERNAL] refactored code: created subfunction to have smaller mainfunction 3
[INTERNAL] added comments, refactoring to have 'omp for' directly inside of 'omp parallel' and not in subfunctions
[INTERNAL] added comments, removed primitive types
[INTERNAL] prevent too depth recursion in quicksort