A bunch of algorithms implemented by me.