Improved plotFunct