avoid call to Math.abs