rectified the ai algorithm with new data.json