Tried a few things and optimized the openMP