updated background file into function