Some algorithm implementations to share.