Implemented gamma correction