added the sprem() function