Fixed the bug in logDisplay()
Fixed the gamma adjustment.
Refactoring.