Finished principal coding for Merge