Revised csv import and extract