Fixed behavior when finding max_idx when more than one occurance of max value
Added intial version of PatchToCumulativeValues.py