cleaned up constructor in nn