implement the basic processing logic