fixed ties bug for RA
Improved data generation