Improved visualization. Renamed some functions.