adds extract function