Correct some bugs
Add visualization functionality