Working on flexible graphing function