change gate arithmetics

according to 2003 paper