adding matrix to lock