Inverted directories. Added factor code