validtion used abs() instaed of fabs()