More work on spm engine