added nb output function