First draft of O(1) datastructure
Related work O(n3) backtracking start