experiment with using functions to compute values
added an example of immutability with d3