Added "getd" function, moved (print_curr_dir)