first implementation and tests for PRM