rewrote the file loading