Split up the code, simplified logging and made it so that a count for each filter can be specified.