updates for c11
added brightness check