fix formatting in op2prv
bug fixes, refactoring, new tests