Completed the "combine" function.