fixed some bugs, should probably not hardcode file names but i'll do that later