Added math function in D3 which Bryan created