Implementation of write-gamma option