update with algoritm