Updated so that it can update the files as well as files within sub
directories