statistical implmentation