working toward a better version of plotFun (Smith C)