improved checking of input data and reporting results