Bak file function