Found the correct way to get file stats. Added buffer loading. Name swapping