matrix fist iteration