override the toString method for ResultNode class