My implementation of certain algorithms