update complex algorithm