Tweaked NN and removed bugs