Changed abs to fabs due to int/double controversy