fixed a few bugs in pinkST so that it works in my version of matlab