add pmag function libraries to code folder