fixed SVG memory leak & added comments.