Updated filter to be faster, implemented trending section (part 4 of the assignment)