add NodeData class to store node data and hopefully help fix memory issues