Created algorithm to include files