add an algorithm Dec 5th