changes to c and solution to d