set up code for parallel computation