Completed code, it prints result.
Have to check the path to see if it is correct