procedural algorithm updated