m-files used for master thesis