worked on the matlab script