Algorithmus upgedated