Completed testing of extract, reworked merge function