added taking denom from A[0][0]