* make second step of the prover happen in O(n) * readability fixes and error handling * chore: Address review comments to merge --------- Co-authored-by: CPerezz <c.perezbaro@gmail.com>