Initial pass at a working implementation of Saito's algorithm