progress on writing an import to pgp function, with full piping