designed the implementation of 'ex' and 'cd'