Moved extraction code to palsar_extractor.R function.