Create a function to merge systems