Re-added rule 6. Now handles IN. Fixed other small bugs.