ternaries are tough
forget ternary
match() sucked
move both images for the shift in merge()