changed pinkST.m into a function