My implementations for algorithms