add two algorithm