added missing gl.viewport, clean up, some comments