added check for max contrast