add two algorithms Oct 22nd