added abs to error difference to avoid negative values