Added new algorithm: combination of previous algorithms; improved test method; output of tests.