Added two new algorithms and a  function