simple implementations of algorithms, for my learning purpose only