implement answer, square and average