Completely rewritten node.c