.spt implementation to fix #148