merge tables - initial code