working through the d3 script - one bit at a time