debugged prim and finished trivial test