fixed bug in node print method and added occurences in print