Add some swi functions