added 'pipe()', fixed some bugs