rename drawPlotted to drawLines and fixed some bugs
add startIndex and endIndex to drawCurve to make more utilize of array object