fork prh to rhpaladin (rlib2) + minor changes