Changed to for_each