steps complete up to formatting X matrix