Changed order of contrast inversion and normalize