added several variables into ns0 and fixed bugs in addNodes implementation. references are now named in ns0