merge file impl