```
var connect = function(root) {
if (root !== null) {
//making all the right edge nodes point to null
var current = root;
while(current) {
current.next = null;
current = current.right;
}
//ensure there's a second level to the tree
if (root.left) {
subConnect(root);
}
}
};
function subConnect(node) {
node.left.next = node.right;
if (node.left.left) {
subConnect(node.left);
subConnect(node.right);
}
}
Output: {0,#,1,2,#,3,4,#,6,#}
Expected: {0,#,1,2,#,3,4,5,6,#}
```

Not particularly sure what's going on here.