Made functions for repeated d3 updates

…and changed a few names