needed to take abs value of the err