R2 function added to helpjm.r