print method and bug fix

Adds the print method and gives a bug fix for setNode