even more changes

Why this algorithm so bad? please help