wrote things for parallelization