fixed bug using abs instead of fabs