function [m] = expand_matrix(m)
    m = [m(:,1) m m(:,end)];
    m = [m(1,:); m; m(end,:)];
end