Added minimum brightness function

Also removed debugging output.