Working solver. Added Sedgewick classes.