added add node function