constructing pseudo code in addNOde()