parallel implementation of phase 2 seems to work and it's very fast