changed algo