added boolean operators, fixed a readability issue in sortBy