Added optimization script -- needs work for D3