completed parts a, b, c. will work on d, e later