refactored sampling methods in count_stat.py. added a binomial losses filter. put some g2 related methods in gtwo.py