added code for bg specific contrasts