Started implementing the algorithm itself, piece by piece, writing tests as I go along... fun times.