added the algorithms