wrap viz1 work into its own function