Initial algorithm implementations.