fixed the calculation for getting an element from a matrix