Making an X by X matrix
misc codes