finished, add additional matlab code