nit: store gd in this.gd so you could move this to prototype as well