Function extractData