some interesting algorithms