added new function to extract data and made script compatible with revision 7 temporarily