Switch from using math.h abs()

it was causing warning about conversion from double to int in Visual C++
compiler