revamped front end to be clearer and more flexible with D3