ns functions