Implementation of some algorithms for myself