started to add visualization and refactor