Fixed NR for solving indiv iterations, added lots of tests, cleaned up