works now on old version of matlab