Update design of algorithm