add statistics to end, move task execution to separate function to allow all/any evaluation