finished logic for returning arrays

added logic for if beginning of one array is greater than end of the
other, then add them together.