Partial functionality added for Question #2. Implementation of cd still has some bugs.