rewrote to eliminate Node