using arrays for nodes and keys instead of keep tracking left middle and right