problem 1 and D matrix fn