add extract fuction