assignment part c almost complete