add second algorithm