Added chainMatrix[][] and rows are now added correctly in  findChainInRow()