Add d3 and fix undefined reference