reworked stabilization algorithm

more efficient