reading nodes to array