implemented the respond function
implemented the checkTarget() in the working memory