Update algorithm.m