Modified file naming function