Added files and dealt with io