Just some algorithms I wrote for future reference.