added middle columns functions for merge and check