Add toString() method to nodes