fixed change from var ww, wh to canvasWidth, canvasHeight in  new code since last merge