fixed setup and file handling because I made a slight error before