Update algorithm.js