modified version of RA TA calculation