add function to extract