part(a) implemented