fixed bugs and added more visualization