modifications to rendering and some fixes to NN