basic code for processing a task