added custom plot function