Algorithm v.1 works stable