Algorithm -1 changes