modified description of Algorithm 2