Add data extraction code