corrected a0 to take into account Tx and Ty