changed unused variable name d to _d