updating matlab code for sizing things