updated ndisc.c

removed few sections and added some optimizations in the code