I changed it to `d` having both positive or negative values..I guess that should take care of both orientations?