Added two new algorithms and a 'chain' function