debugging beam gradient