was doing some space allocation inside parallel loop. moved to outside ...

...loop for thread safety.