fixed contrast and brightness
updated code: ready for testing