refactored code. Added new answer property to task object