Update Master w/ Federico's Version

This code includes Federico’s files that should be backward compatible
in Matlab.