add of a part c code, hopefully this is what the professor wants