added expansion code for part c