2012 paper implementation and My Matlab function