Fixed bug in the logic and added answer_match functionality