Cleaned up reduce_intensity_levels.m