print nodes method added