fixed absolute value order of operations issues