redraft of JPS, clean re-impl