Added more logging and changed the output filepath