Refactoring. Added an example use. Added some predicates.