Made outer loop parallel