added SPM file creation function