It seems `Math.abs()` is missed. What about negative values?
And also please, add `{}` arround the `procedure.apply(...)`