Created drawAlphas function to draw the entire dataset using fewer calls to begin/closePath(). Changed setdataset to call drawAlphas only once after looping and creating the dict.