added gamma encoding