move plot into future function