wrote a few of the spkw functions, needs to be tested.