found bug in matlab method, have to correct this...