updated phrets. minor tweaks to functions.