A bunch of algorithm implementations