added result reporting and some fixes