first working openmp version (even though not in a very smart way)