after a merge
Big M theory in some functions