now setting a value between 0 and 255 instead of always using 255.