added the algorithms correctly