changed NN and fixed assign prior vector