fixing inverted subtraction for shifting