branched for 0.3 and added wprifm.R function