Changed file loading function