replaced Math.sign