use abs instead of if+neg