Line merging program