solution of join matris together