modified the ng sample