Implementing all_answers function