Implemented the O(n) version again (shared memory) with parallelism. Seems to be working