Changed the extract pipe, added some pipe functions, fixed some bugs.