final version of parallel script