added $d to use instead of "this", although "this" can still be used