Extracting canvas operations out of loop to improve drawing performance
Removing unnecessary fillStyle command