new function for extracting parent occupation