Modify main to change directories