fixed nPG calculation bug