fixed missed abs()