path walk
functions for assignment 2 finished.