Updated to work per file, I hope