Update the following text to be more logical:
They allied themselves with Shams. They besieged Ray and eventually imprisoned Majd in the hilltop fortress of Tabarak, adjoining the city.
Allying themselves with Shams, they besieged Ray and eventually imprisoned Majd in the hilltop fortress of Tabarak, adjoining the city.