various algorithms

2021