Logic

merge logic