Simple Function Plotter in JS