add some algorithm codes