Reimplement prover to be more efficient