Added separate running file, and handled changing of working directory