Minor cleanup, added loops
cleaned up predicate names to underscore form