Fix sp function to check multiple words