basic statistics + some fixes