refactor nextCubeItems
test discontinuous graph (working)
dynamic type casting for discontinuous hypothesis
resolve a memory leak
bug fix the last case