Almost linear equations-first implementation