implemented sorting by upvotes or date