put some finishing touches on my matlab code