visialization and debugging algorithm

graphic is very helpful for debugging ^_^