removing/printing nodes correctly