Algorithms implemented.

Now let's test this.