correct matrix mapping