Update function to merge as well. Need to still decide on how to handle zero values with logarithm