Use layer matrix to compute score.

- but still too slow...