implemented tone mapping but still very buggy