Program combining two separate algorithms

Program combining two separate algorithms