implement another two algorithms