Algorithms

Hopefully adding algorithms here that I develop, that I couldn't find a satisfactory solution for elsewhere.