Fixed the aforementioned issues by basically doing everything correctly and recognizing the importance of knowing the file directory.