refactored fetch value function to store variables inside of d3plus.data