finding 3s in a matrix