fixed bug in TAPS_compare