start writing func to generate response