first attempt at making zero brightness possible.
max and min working, but code ugly
some comments.