Added some additional logic and comments to the processing example