reusable filter most voted lines function