finalized extractor and added rules