Made compatible with MATLAB 2014b