made the loadFile function more versatile

may not work though