Code to Extract data