consolidate code and add ui to change viz