trying to calculate pivot point