implementing extract script