Script for processing results