Adding magic matrix