ns tools.main corrected