added sps_func.h