Replaced $filename with $f