Rewrite the 222 solver