Refactored dssim.c to allow multiple comparisons at once