Implement process function.