Not very elegant implementation of parallelism, but helps speed up things