recursive data type with methods for node graph