restyle demo
reduce scope of function
add categorical colours from d3.js