preliminary file loading code