finding it difficult to duplicate a d3 example