ISSUE-26/SOLUTION-17: incorrect algorithm replaced