function d changed