Rewrote predicate logic.
Merge remote-tracking branch 'angrychuy/master'