Algorithm modified.