Added a extract function