changed successor generation loop