wrote homo_filter and testing function, tested pretty robustly