radical change of the parallel code. need to fix final bug with gather and add counters